package com.entity;

/**
 * @author wzm
 * @create 2023-06-13 10:26
 */
//实体类  对应数据库的表  new Student()对应数据的一行数据
public class Student {
    //属性  和数据库中表的字段相对应
    private Integer id;//id
    private String username;//username
    private Integer age;//age
    private String address;//地址
    private Integer ordered;//排序
    private Integer status;//状态

//    private Integer grade_id;

    //如果需要获取到对应外键表中的数据进行展示 建议 持有外键表的一个对象
    private Grade grade;

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                ", ordered=" + ordered +
                ", status=" + status +
                ", grade=" + grade +
                '}';
    }

    public Grade getGrade() {
        return grade;
    }

    public void setGrade(Grade grade) {
        this.grade = grade;
    }

    public Student(Integer id, String username, Integer age, String address, Integer ordered, Integer status, Grade grade) {
        this.id = id;
        this.username = username;
        this.age = age;
        this.address = address;
        this.ordered = ordered;
        this.status = status;
        this.grade = grade;
    }

    //get  set  构造  toString


    public Student() {
    }

    public Student(String username, Integer age, String address, Integer ordered, Integer status) {
        this.username = username;
        this.age = age;
        this.address = address;
        this.ordered = ordered;
        this.status = status;
    }


    public Student(Integer id, String username, Integer age, String address, Integer ordered, Integer status) {
        this.id = id;
        this.username = username;
        this.age = age;
        this.address = address;
        this.ordered = ordered;
        this.status = status;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getOrdered() {
        return ordered;
    }

    public void setOrdered(Integer ordered) {
        this.ordered = ordered;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

}
